import type{Api_Response_Dto} from '../dto/response/Api_Response_Dto'
import { ElLoading,ElMessage } from 'element-plus'

let loading:any

export const start_loading=(msg?:string)=>{
    loading=ElLoading.service({
        lock:true,
        text:msg||"请稍后...",
        background:'rgba(0, 0, 0, 0.7)',
    })
}

export const close_loading=()=>{
if(loading){
    loading.close();
}
}

export const notice=(response:Api_Response_Dto)=>{
    if(response.code===0){
        ElMessage.success(response.message);
    }else{
        ElMessage.error(response.message);
    }
}

